package com.egao.orderB.service.impl;

import com.egao.common.core.damon.results.PageResult2;
import com.egao.common.core.web.JsonResult;
import com.egao.common.system.entity.User;
import com.egao.orderB.biz.BillFeeTotalBiz;
import com.egao.orderB.entity.BillFeeTotal;
import com.egao.orderB.service.BillFeeTotalService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

//import com.egao.orderB.mapper.BillFeeTotalMapper;
//import javax.transaction.Transactional;

/**
 * 费用名称管理服务实现类
 * @author : Doman
 * @date : 2020-12-10 15:11:17
 * @version ：1.0
 */
@Service
public class BillFeeTotalServiceImpl /*extends ServiceImpl<BillFeeTotalMapper, BillFeeTotal> */implements BillFeeTotalService {

	@Autowired
	private BillFeeTotalBiz billFeeTotalBiz;

    /**
    @Override
    public PageResult<BillFeeTotal> listPage(PageParam<BillFeeTotal> page) {
        List<BillFeeTotal> records = baseMapper.listPage(page);
        return new PageResult<>(records, page.getTotal());
    }

    @Override
    public List<BillFeeTotal> listAll(Map<String, Object> page) {
        return baseMapper.listAll(page);
    } */


    @Override
    public JsonResult list(PageResult2<T> page, BillFeeTotal billFeeTotal, User loginUser)  throws Exception{
        return billFeeTotalBiz.list(page,billFeeTotal,loginUser);
    }

    @Override
    public JsonResult list(BillFeeTotal billFeeTotal, User loginUser) {
        return JsonResult.ok().setData(billFeeTotalBiz.list(billFeeTotal,loginUser));
    }

    @Override
    public JsonResult getById(BillFeeTotal billFeeTotal) {
        return JsonResult.ok().setData(billFeeTotalBiz.getById(billFeeTotal));
    }

    @Override
    public JsonResult save(BillFeeTotal billFeeTotal, User loginUser) {
        if (billFeeTotalBiz.save(billFeeTotal, loginUser)) {
            return JsonResult.ok("添加成功");
        }
        return JsonResult.error("添加失败");
    }

    @Override
    public JsonResult update(BillFeeTotal billFeeTotal, User loginUser) {
        if (billFeeTotalBiz.update(billFeeTotal, loginUser)) {
            return JsonResult.ok("修改成功");
        }
        return JsonResult.error("修改失败");
    }

    @Override
    public JsonResult remove(BillFeeTotal billFeeTotal, User loginUser) {
        if (billFeeTotalBiz.remove(billFeeTotal, loginUser)) {
            return JsonResult.ok("删除成功");
        }
        return JsonResult.error("删除失败");
    }

}
